//package com.example.office.controller;
//
//import com.example.office.wxpush.TemplateData;
//import com.example.office.wxpush.WechatTemplate;
//import org.springframework.beans.factory.annotation.Autowired;
//import org.springframework.stereotype.Controller;
//import org.springframework.web.bind.annotation.RequestMapping;
//import org.springframework.web.client.RestTemplate;
//
//import java.util.HashMap;
//import java.util.Map;
//
///**
// * @Author jujh
// * @Date 2018/8/28
// */
//@Controller
//public class WxController {
//
//    @Autowired
//    private RestTemplate restTemplate;
//
//    private String serviceHost = "https://api.weixin.qq.com";
//
//
//    @RequestMapping(value = "/wxpush")
//    public String wxpush() {
//        String url = "https://api.weixin.qq.com/cgi-bin/message/template/send?access_token=13_vXEhkAf3BbvVBdscaCt0WYNO1KTm4Su-WG5OPkv8Yj2TOtsoTwFEMe-CbTLbXj_8YELzVpA_SHqnqhoVWK6sBvww3SvmDTlzZq9MVRObe49TWQrR4NFx9fA-cHaQmB3mj2MUdfknqAkH8FH_WLNfAJAJYA";
//        WechatTemplate wechatTemplate = new WechatTemplate();
////        wechatTemplate.setTouser("touser");
////        wechatTemplate.setUrl("http://www.baidu.com");
////        wechatTemplate.setTemplate_id("template_id");
////        Map<String, TemplateData> map = new HashMap<>();
////        TemplateData templateData = new TemplateData();
////        templateData.setValue("value");
////        templateData.setColor("#q123123213");
////        map.put("data", templateData);
////        wechatTemplate.setData(map);
//        String result = restTemplate.postForObject(url, wechatTemplate, String.class);
//        System.out.println(result);
//        return "";
//    }
//
////
////    @Override
////    public WeixinResponse sendTemplateMessage(String accessToken, WeixinTemplate weixinTemplate) {
////        WeixinResponse weixinResponse = null;
////        String url = new StringBuffer(serviceHost).append("/cgi-bin/message/template/send?access_token=")
////                .append(accessToken).toString();
////        weixinResponse = restTemplate.postForObject(url, weixinTemplate, WeixinResponse.class, new HashMap<String, String>());
////        return weixinResponse;
////    }
////
////    public static void main(String[] args) {
////        String url ="";
////        restTemplate.postForObject(url,"",String.class);
////    }
//}
